import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/education/train_plan/people_counting_entity.dart';

PeopleCountingEntity $PeopleCountingEntityFromJson(Map<String, dynamic> json) {
  final PeopleCountingEntity peopleCountingEntity = PeopleCountingEntity();
  final int? makeUpExamination = jsonConvert.convert<int>(json['makeUpExamination']);
  if (makeUpExamination != null) {
    peopleCountingEntity.makeUpExamination = makeUpExamination;
  }
  final int? planNum = jsonConvert.convert<int>(json['planNum']);
  if (planNum != null) {
    peopleCountingEntity.planNum = planNum;
  }
  final int? numberOfAbsentees = jsonConvert.convert<int>(json['numberOfAbsentees']);
  if (numberOfAbsentees != null) {
    peopleCountingEntity.numberOfAbsentees = numberOfAbsentees;
  }
  final int? compliance = jsonConvert.convert<int>(json['compliance']);
  if (compliance != null) {
    peopleCountingEntity.compliance = compliance;
  }
  final int? notMeetingStandards = jsonConvert.convert<int>(json['notMeetingStandards']);
  if (notMeetingStandards != null) {
    peopleCountingEntity.notMeetingStandards = notMeetingStandards;
  }
  return peopleCountingEntity;
}

Map<String, dynamic> $PeopleCountingEntityToJson(PeopleCountingEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['makeUpExamination'] = entity.makeUpExamination;
  data['planNum'] = entity.planNum;
  data['numberOfAbsentees'] = entity.numberOfAbsentees;
  data['compliance'] = entity.compliance;
  data['notMeetingStandards'] = entity.notMeetingStandards;
  return data;
}

extension PeopleCountingEntityExtension on PeopleCountingEntity {
  PeopleCountingEntity copyWith({
    int? makeUpExamination,
    int? planNum,
    int? numberOfAbsentees,
    int? compliance,
    int? notMeetingStandards,
  }) {
    return PeopleCountingEntity()
      ..makeUpExamination = makeUpExamination ?? this.makeUpExamination
      ..planNum = planNum ?? this.planNum
      ..numberOfAbsentees = numberOfAbsentees ?? this.numberOfAbsentees
      ..compliance = compliance ?? this.compliance
      ..notMeetingStandards = notMeetingStandards ?? this.notMeetingStandards;
  }
}
